import 'package:cotton_candy/notifier/theme_notifier.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class Button extends StatelessWidget {
  final Widget child;
  final Function onPressed;
  Button({this.child, this.onPressed});
  @override
  Widget build(BuildContext context) {
    double height = 50;
    ThemeNotifier notifier = context.watch();
    return Container(
      height: height,
      decoration: BoxDecoration(
          gradient: LinearGradient(
              begin: Alignment.topCenter,
              end: Alignment.bottomCenter,
              colors: [
                notifier.primaryColor,
                notifier.primaryColor,
              ]),
          borderRadius: BorderRadius.circular(25)),
      child: RaisedButton(
        shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(25)),
        color: Colors.transparent,
        textColor: Color.fromARGB(240, 255, 255, 255),
        elevation: 0,
        highlightElevation: 0,
        onPressed: onPressed,
        child: Container(
          alignment: Alignment.center,
          height: height,
          child: child,
        ),
      ),
    );
  }
}
